package com.czxy.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.czxy.tanhua.entity.BlackList;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 爱吃豆的土豆、
 * @Date 2023/4/6 15:04
 */
@Mapper
public interface BlackMapper extends BaseMapper<BlackList> {
    @Select("SELECT * FROM `tb_black_list` LIMIT #{current} ,#{size} ")
    public List<BlackList> findAllBlack(@Param("current") Integer current,@Param("size") Integer size);

    @Select("SELECT * FROM `tb_black_list` WHERE black_user_id = #{userid}")
    public BlackList findBlackList(@Param("userid") Long userid);

    @Delete("DELETE FROM `tb_black_list` WHERE black_user_id = #{userid}")
    public void deleteblack(@Param("userid") Long userid);

}
